<?php
class Model_UserAccount extends MVC_MODEL {
	/**
	 * @var object SQL
	 */
	public $oDb_UserAccount;
//	private $aData = array();
	
	public function __construct(){
		parent::__construct();
		$this->oDb_UserAccount = new Db_UserAccount();
	}
	public function setDataUserAccount(){
		$this->setData('user_id',$_REQUEST[user_id]);
		$this->setData('can_be_downloaded_items',$_REQUEST[can_be_downloaded_items]);
		$this->setData('downloaded_items',$_REQUEST[downloaded_items]);
		$this->setData('start_date',$_REQUEST[start_date]);
		$this->setData('end_date',$_REQUEST[end_date]);
		return $this->aData;
	}
	public function insertUserAccount(){
		$aData = $this->setDataUserAccount();
		$this->oDb_UserAccount->doInsertUserAccount($aData);
	}
	public function listUserAccount(){
		$this->oDb_UserAccount->doListUserAccount();
		return $this->oDb_UserAccount;
	}
	public function deleteUserAccountById($id){
		$this->oDb_UserAccount->doDeleteUserAccountById($id);
//		return $this->oDb_UserAccount;
	}
	public function getUserAccountById($id){
		return $this->oDb_UserAccount->doGetUserAccountById($id);
//		return $this->oDb_UserAccount;
	}
	public function getUserAccountByIdFo($id){
		$this->oDb_UserAccount->doGetUserAccountById($id);
		return $this->oDb_UserAccount;
	}
	public function updateUserAccountByID($id){
		$aData = $this->setDataUserAccount();
		$this->oDb_UserAccount->doUpdateUserAccountById($aData,$id);
	}
    public function getListActive(){
         $this->oDb_UserAccount->doListUserAccountActive();
		return $this->oDb_UserAccount;
    }
    public function doInsertTrans($aData){
        return $this->oDb_UserAccount->doInsertTrans($aData);
    }
	public function getUser(){
        $this->oDb_UserAccount->doGetUser();
        return $this->oDb_UserAccount;
    }
}
?>
	